const { defineConfig } = require('@vue/cli-service')
const port = process.env.port || process.env.npm_config_port || 9527 // dev port
module.exports = defineConfig({
  transpileDependencies: true,
  chainWebpack: config => {
    config
      .plugin('html')
      .tap(args => {
        args[0].title = 'light里特创意'
        return args
      })
  },
  devServer: {
    // host: "localhost",
    port: port,
    open: true,
    proxy: {
      // 配置跨域
      "/prod-api": {
        target: "http://182.92.151.136/", 
        changOrigin: true,
        onProxyReq(proxyReq) {
          proxyReq.removeHeader("origin");
        },
        pathRewrite: {
          "^/prod-api": "prod-api",
        },
      },
    },
    // before: require('./mock/mock-server.js')
  },
})
